﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Tycho.Parser.Syntax;

namespace Tycho.Parser.Tests.Syntax {
    [TestFixture]
    public class CaptureAccumulatorSpecification {
        [Test]
        public void AddNonMultipleShouldAddCaptureAsNotMultiple () {
            var accumulator = new CaptureAccumulator ();

            accumulator.Add ("name");

            Assert.AreEqual (false, accumulator.Captures["name"]);
        }

        [Test]
        public void AddNonMultipleTwiceShouldAddCaptureAsMultiple () {
            var accumulator = new CaptureAccumulator ();

            accumulator.Add ("name");
            accumulator.Add ("name");

            Assert.AreEqual (true, accumulator.Captures ["name"]);
        }

        [Test]
        public void AddMultipleShouldAddCaptureAsMultiple () {
            var accumulator = new CaptureAccumulator ();

            accumulator.Add ("name", true);

            Assert.AreEqual (true, accumulator.Captures ["name"]);
        }
    }
}
